﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ControlsLib.Filters;
using GestionePolveriLib.BL.FilterBags;
using GestionePolveriLib.Utilities;
using GestionePolveriLib.BL;
using GestionePolveriLib.Facades;
using GestionePolveriLib.BL.Filters;

namespace GestionePolveri2.Filters
{
    public partial class AnagraficaFattureFilter : AnagraficaFattureFilterBase
    {
        public AnagraficaFattureFilter()
        {
            InitializeComponent();

            if (!this.DesignMode)
            {
                RefreshData();

                this.FromDate = DateTime.Now;
                this.ToDate = DateTime.Now;
            }
        }

        protected override void OnResetFilter(EventArgs e)
        {
            base.OnResetFilter(e);

            FilterBag.NumFatt = null;
        }

        protected override void OnExecuteFilter(EventArgs e)
        {
            FilterBag.NumFatt = this.dyntxtNumFattura.Text;

            if (FilterBag.NumFatt == null)
            {
                OnResetFilter(e);
                this.OnFilterButtonClick();
            }
            else
            {
                base.OnExecuteFilter(e);
            }
        }

        public override void RefreshData()
        {
        }
    }


    public class AnagraficaFattureFilterBase : FilterContainerBase2<AnagraficaFattureFilterBag> { }
}
